const fs = require('fs');
const path = require('path');

module.exports = async function () {

    console.log('install script is running!');

    // const script_path = path.join(__dirname, `/../model/City.model`);
    // koahub.logger.debug(script_path);
    // const City= koahub.common.requireDefault(script_path);
    const City = require('../model/City.model');
    City.findOne((err, data) => {
        if (!data) {
            const cityData = require('../initdata/cities');

            // koahub.logger.info(cityData);
            City.create({data: cityData});
        }
    });

    let schema = require('../model/Mapmark.schema');
    let Mapmark = koahub.mongoose.model('Mapmark', schema, 'Mapmark');
};